const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token,
  shopInfo: state => state.user.shopInfo,
  qiniuUploadUrl: state => state.settings.qiniuUploadUrl,
  qiniuResUrl: state => state.settings.qiniuResUrl,
  permission_routes: state => state.permission.routes,
  membersType: state => state.user.membersType,
  members: state => state.user.members,
  renewMembersCondition: state => state.user.renewMembersCondition,
  taskList: state => state.user.taskList,
  task: state => {
    const list = state.user.taskList;
    for (let i = 0; i < list.length; i++) {
      const t = list[i];
      if (!t.isCompleted) {
        return t;
      } else {
        return false;
      }
    }
  },

  hidden: state => {
    // eslint-disable-next-line no-unused-vars
    const temp = state.current;
    if (typeof document.hasFocus !== 'function') {
      return document.hidden;
    }
    return !document.hasFocus();
  }
};
export default getters;
